import shutil
import subprocess
import os
fname = input('请输入文件名()：')
shutil.copy('/root/PycharmProjects/untitled/%s' % fname,'/root/Python/file')
os.chdir('/root/Python')
add = subprocess.run('git add .',shell=True)
print('add:%s' % add.returncode)
fpush = input('请输入备注:')
os.chdir('/root/Python')
commit = subprocess.run('git commit -m "%s" ' % fpush,shell=True)
print('commit:%s' % commit.returncode)
os.chdir('/root/Python')
push1 = subprocess.run('git push',shell=True)
print('push:%s' % push1.returncode)